<html>
<head>
	<meta charset="UTF-8">
	<meta content="IE=edge" http-equiv="X-UA-Compatible">
	<meta content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no, width=device-width" name="viewport">
	<title>4604：The kth maximum number</title>
	<!-- css -->
	<link href="../css/base.min.css" rel="stylesheet">
	<link href="../css/project.min.css" rel="stylesheet">
	
	<!-- favicon -->
	<!-- ... -->
</head>
<body class="page-brand">
	<header class="header header-transparent header-waterfall ui-header">
		<ul class="nav nav-list pull-left">
			<li>
				<a data-toggle="menu" href="#menu">
					<span class="icon icon-lg">menu</span>
				</a>
			</li>
		</ul>
		<a class="header-logo header-affix-hide margin-left-no margin-right-no" data-offset-top="213" data-spy="affix">The kth maximum number</a>
		<span class="header-logo header-affix margin-left-no margin-right-no" data-offset-top="213" data-spy="affix">The kth maximum number</span>
	</header>
	<nav aria-hidden="true" class="menu" id="menu" tabindex="-1">
		<div class="menu-scroll">
			<div class="menu-content">
				<a class="menu-logo" href="../index.html">BZOJ离线题库</a>
				<ul class="nav">
					<li>
						<a class="waves-attach" data-toggle="collapse" href="#problems">题目</a>
						<ul class="menu-collapse collapse in" id="problems">
							<li>
								<a class="waves-attach" href="../index.html">主页</a>
							</li>
							<li>
								<a class="waves-attach" href="../list.html">题目列表</a>
							</li>
						</ul>
					</li>
					<li>
						<a class="collapsed waves-attach" data-toggle="collapse" href="#about">关于</a>
						<ul class="menu-collapse collapse" id="about">
							<li>
								<a class="waves-attach" href="../about.html">关于此项目</a>
							</li>
						</ul>
					</li>
					
				</ul>
			</div>
		</div>
	</nav>
	<main class="content">
		<div class="content-header ui-content-header">
			<div class="container">
				<h1 class="content-heading">
                The kth maximum number                </h1>
                <p>时间限制：50s&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  空间限制：512MB</p>			</div>
		</div>
		<div class="container">
			<section class="content-inner margin-top-no">
				<div class="row">
					<div class="col-lg-13 col-md-13">
						<div class="card margin-bottom-no">
							<div class="card-main">
								<div class="card-inner">
									
                                <h3>题目描述</h3><p><div>神犇Aleph在陪蒟蒻Bob玩一个游戏。神犇Aleph随手在地面上画了一个巨大无比的二维平面，然后在其上做一些微</div>
<div>小的贡献或教蒟蒻Bob做人。由于神犇Aleph是队爷，所以有时他会施用&quot;队爷光环&quot;这一魔法，在二维平面上的某坐</div>
<div>标整点处添加一个权值为v的贡献；又由于神犇Aleph是神犇，所以有时他会施用&quot;嘲讽&quot;这一技能，询问蒟蒻Bob在</div>
<div>矩形区域(x1, y1), (x2, y2)(x1&le;x2且y1&le;y2，包括边界)中，神犇Aleph所做的第k大的贡献是多少。由于神犇Al</div>
<div>eph是Au爷，所以他不会在同一个坐标整点处做两次或两次以上的贡献。现在神犇Aleph希望蒟蒻Bob回答他的每次</div>
<div>询问。然而蒟蒻Bob傻傻不会做，于是来求助您，宇宙第一神犇，请您来回答神犇Aleph的每次询问。</div>
<p></p></p><hr/><h3>输入格式</h3><p><div>输入的第一行为两个正整数N, Q，表示横纵坐标的范围和神犇Aleph的操作次数（包括贡献次数和询问次数）。</div>
<div>接下来Q行，每行代表神犇Aleph的一个操作，操作格式如下：</div>
<div>首先第一个数字type，表示操作种类。type=1表示贡献，type=2表示询问。</div>
<div>若type=1，接下来会有三个正整数x, y, v，表示在坐标整点(x, y)添加一个贡献v。(1&le;x, y&le;N, 1&le;v&le;10^9)</div>
<div>若type=2，接下来会有五个正整数x1, y1, x2, y2, k，表示询问矩形区域(x1, y1), (x2, y2)中第k大的贡献。</div>
<div>(1&le;x1&le;x2&le;N，1&le;y1&le;y2&le;N，1&le;k&le;Q)</div>
<div>初始时平面上不存在贡献。</div>
<div>本题共有7组测试数据。对于所有的数据，N&le;500,000。</div>
<div>Q的范围见下表：</div>
<div>测试点1-2<span class="Apple-tab-span" style="white-space: pre;">	</span>Q=1,000</div>
<div>测试点3-7<span class="Apple-tab-span" style="white-space: pre;">	</span>Q=50,000<span class="Apple-tab-span" style="white-space: pre;">	</span></div>
<p></p></p><hr/><h3>输出格式</h3><p><div>对于每个询问(type=2的操作)，回答第k大的贡献。若不存在第k大的贡献，请输出&quot;NAIVE!ORZzyz.&quot;（输出不含双引号）。</div>
<p></p></p><hr/><h3>样例输入</h3><pre>
10 7
1 1 1 1
1 2 2 3
1 4 1 2
1 3 4 4
2 1 1 4 1 3
2 2 2 3 5 4
2 2 1 4 4 2</pre><hr/><h3>样例输出</h3><pre>NAIVE!ORZzyz.
NAIVE!ORZzyz.
3</pre><hr/><h3>提示</h3><p>没有写明提示</p><hr/><h3>题目来源</h3><p>Idea By Aleph, Description & Data cases By jinlifu1999.
</p>
								</div>
							</div>
						</div>
					</div>
				</div>
				
				
			</section>
		</div>
	</main>

	<div class="fbtn-container">
		<div class="fbtn-inner">
			<a class="fbtn fbtn-lg fbtn-brand-accent waves-attach waves-circle waves-light waves-effect" data-toggle="dropdown" aria-expanded="true"><span class="fbtn-text fbtn-text-left">Menu</span><span class="fbtn-ori icon">apps</span><span class="fbtn-sub icon">close</span></a>
			<div class="fbtn-dropup">
				<a class="fbtn fbtn-brand waves-attach waves-circle waves-light waves-effect" href="../list.html" target="_self"><span class="fbtn-text fbtn-text-left">题目列表</span><span class="icon">menu</span></a>
				<a class="fbtn fbtn-green waves-attach waves-circle waves-effect" href="../index.html" target="_self"><span class="fbtn-text fbtn-text-left">返回主页</span><span class="icon">home</span></a>
				<a class="fbtn waves-attach waves-circle waves-effect" href="http://www.lydsy.com/JudgeOnline/submitpage.php?id=4604" target="_blank"><span class="fbtn-text fbtn-text-left">提交代码</span><span class="icon">send</span></a>
				<a class="fbtn fbtn-orange waves-attach waves-circle waves-effect" href="http://www.lydsy.com/JudgeOnline/wttl/wttl.php?pid=4604" target="_blank"><span class="fbtn-text fbtn-text-left">试题讨论</span><span class="icon">chat</span></a>
				
			</div>
		</div>
	</div>

	<!-- js -->
	<script src="../js/jquery.min.js"></script>
	<script src="../js/base.min.js"></script>
	<script src="../js/project.min.js"></script>
</body>
</html>